﻿using System;
using WF_AppFuel.Validation.Base;
using WF_AppFuel.Validation.Engines;

namespace WF_AppFuel.Validation.Attributes
{
    /// <summary>
    /// Attribute for specifying that a property must match a pattern.
    /// </summary>
    /// <author>Arjay C. Nacion</author>
    public sealed class MatchesPattern : BaseValidationAttribute
    {
        private string pattern;

        /// <param name="pattern">The pattern to be used</param>
        public MatchesPattern(string pattern)
        {
            this.pattern = pattern;
        }

        public override Type ValidationEngineType
        {
            get { return typeof(MatchesPatternValidationEngine); }
        }

        public string Pattern
        {
            get { return this.pattern; }
        }
    }
}
